package com.zhehekeji.opsys.api.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @ClassName TVoteQrcodeDetail
 * @Description TODO
 * @author chenweiliu chenwei.liu@163.com
 * @date 2016-7-25   下午2:19:41
 */
@Entity
@Table(name="t_vote_qrcode_detail")
public class TVoteQrcodeDetail implements java.io.Serializable{

	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = 6672933766962250801L;
	private Long id;
	private String code;
	private String userId;
	private TVoteQrcode tvoteQrcode;
	private Date createTime;
	private Date bindTime;
	private Integer status;
	private Long cpCode;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID",length=20,nullable=false,unique=true)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="CODE",length=64,nullable=true)
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name="USER_ID",length=64,nullable=true)
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="QRCODE_ID")
	public TVoteQrcode getTvoteQrcode() {
		return tvoteQrcode;
	}
	public void setTvoteQrcode(TVoteQrcode tvoteQrcode) {
		this.tvoteQrcode = tvoteQrcode;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME",nullable=true)
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="BIND_TIME",nullable=true)
	public Date getBindTime() {
		return bindTime;
	}
	public void setBindTime(Date bindTime) {
		this.bindTime = bindTime;
	}
	@Column(name="STATUS",length=2,nullable=true)
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name="CP_CODE",length=20,nullable=true)
	public Long getCpCode() {
		return cpCode;
	}
	public void setCpCode(Long cpCode) {
		this.cpCode = cpCode;
	}
}

